package dao.dto;

import bo.Client;
import java.util.GregorianCalendar;
import util.Util;

public class InterventionDto {
        //Demande d’intervention
        private int _idIntervention;
        private ClientParticulierDto _client;
        private AdresseDto _adresse;
        private GregorianCalendar _dateDemande; //date
        private String _descriptionDemande;
        private PrioriteDto _prioriteDemande;
        private int _parent;

        //Planification d’une intervention
	private GregorianCalendar _dateIntervention; //date
	private TechnicienDto _technicien;
	private PrioriteDto _prioriteIntervention;
        
        
        //Traitement d’une intervention
	private GregorianCalendar _heureDebut; // date, heure, minute
        
        //Cloture
        private GregorianCalendar _heureFin;    // date, heure, minute
        private String  _descriptionIntervention;
        private int _enfant;
        private StatutDto _statut;
       
        /*
         * Correspondance status bo et dto
         * Cree         = CR
         * Planifiee    = PL
         * EnCours      = EN
         * Cloturee     = CL
         * Suivis       = SU
         * Deplanifiee  = DE
         * Annulee      = AN
        */
        
        //Constructeurs
                public InterventionDto(GregorianCalendar dateDemande) {

            setDateDemande(dateDemande);            
            
        }
        
        // Créer une intervention - Descendre une demande d'intervention
        public InterventionDto( ClientParticulierDto client, AdresseDto adresse, GregorianCalendar dateDemande
                                , String descriptionDemande, PrioriteDto prioriteDemande) {
            setClientParticulierDto(client);
            setAdresse(adresse);
            setDateDemande(dateDemande);            
            setDescriptionDemande(descriptionDemande);            
            setPrioriteDemande(prioriteDemande);
        }
        
        public InterventionDto( int IdIntervention, ClientParticulierDto client, AdresseDto adresse, GregorianCalendar dateDemande
                                , String descriptionDemande, PrioriteDto prioriteDemande) {
            setIdIntervention(IdIntervention);
            setClientParticulierDto(client);
            setAdresse(adresse);
            setDateDemande(dateDemande);            
            setDescriptionDemande(descriptionDemande);            
            setPrioriteDemande(prioriteDemande);
        }
        
     
       // Remonter des listes ouvertes
       public InterventionDto(int idIntervention,ClientParticulierDto client, AdresseDto adresse, GregorianCalendar dateDemande
                                , String descriptionDemande, PrioriteDto prioriteDemande
                                , GregorianCalendar dateIntervention, TechnicienDto technicien, PrioriteDto prioriteIntervention
                                , GregorianCalendar heureDebut
                                ,StatutDto statut,int parent) {
            setIdIntervention(idIntervention);
            setClientParticulierDto(client);
            setAdresse(adresse);
            setDateDemande(dateDemande);            
            setDescriptionDemande(descriptionDemande);            
            setPrioriteDemande(prioriteDemande);
            setDateIntervention(dateIntervention);
            setTechnicien(technicien);
            setPrioriteIntervention(prioriteIntervention);
            setHeureDebut(heureDebut);
            setStatut(statut);
            setParent(parent);
        }

               // Remonter des listes ouvertes
       public InterventionDto(int idIntervention,ClientParticulierDto client, AdresseDto adresse, GregorianCalendar dateDemande
                                , String descriptionDemande, PrioriteDto prioriteDemande
                                , GregorianCalendar dateIntervention, TechnicienDto technicien, PrioriteDto prioriteIntervention
                                , GregorianCalendar heureDebut,GregorianCalendar heureFin,String descriptionIntervention
                                ,StatutDto statut,int parent) {
            setIdIntervention(idIntervention);
            setClientParticulierDto(client);
            setAdresse(adresse);
            setDateDemande(dateDemande);            
            setDescriptionDemande(descriptionDemande);            
            setPrioriteDemande(prioriteDemande);
            setDateIntervention(dateIntervention);
            setTechnicien(technicien);
            setPrioriteIntervention(prioriteIntervention);
            setHeureDebut(heureDebut);
            setHeureFin(heureFin);
            setDescriptionIntervention(descriptionIntervention);            
            setStatut(statut);
            setParent(parent);
        }

       
	//Setters
        public void setIdIntervention(int idIntervention) {
            Util.checkPositive(idIntervention);
            this._idIntervention = idIntervention;
	}
        
        private void setClientParticulierDto(ClientParticulierDto client) {
              Util.checkObject(client);
              this._client = client;
        }
        
        public void setAdresse(AdresseDto adresse) {
		Util.checkObject(adresse);
                this._adresse = adresse;
	}	
	
        public void setDateDemande(GregorianCalendar dateDemande) {
            Util.checkObject(dateDemande);
            this._dateDemande = dateDemande;
	}

        public void setDescriptionDemande(String descriptionDemande) {
		Util.checkString(descriptionDemande);
                this._descriptionDemande = descriptionDemande;
	}

        public void setPrioriteDemande(PrioriteDto prioriteDemande) {
		Util.checkObject(prioriteDemande);
                this._prioriteDemande = prioriteDemande;
	}

        public void setParent(int parent) {
                this._parent = parent;
	}
        
        public void setDateIntervention(GregorianCalendar dateIntervention) {
            this._dateIntervention = dateIntervention;
	}
        
        public void setTechnicien(TechnicienDto technicien) {
            this._technicien = technicien;
	}

        public void setPrioriteIntervention(PrioriteDto prioriteIntervention) {
            this._prioriteIntervention = prioriteIntervention;
        }

        public void setHeureDebut(GregorianCalendar heureDebut) {
            this._heureDebut = heureDebut;
	}
        
        public void setHeureFin(GregorianCalendar heureFin) {
            this._heureFin = heureFin;
	}
        
        public void setDescriptionIntervention(String descriptionIntervention) {
                this._descriptionIntervention = descriptionIntervention;
	}
        
        public void setStatut(StatutDto statut) {
            Util.checkObject(statut);
            this._statut = statut;
	}

        public void setEnfant(int enfant) {
                this._enfant = enfant;
	}
        
        //Getters 
        public int getIdIntervention() {
            return _idIntervention;
	}
	
        public ClientParticulierDto getClient() {
            return _client;
	}
	
        public AdresseDto getAdresse() {
            return _adresse;
	}	

      	public GregorianCalendar getDateDemande() {
            return _dateDemande;
	}
        
        public String getDescriptionDemande() {
            return _descriptionDemande;
	}

        public PrioriteDto getPrioriteDemande() {
            return _prioriteDemande;
	}

        public int getParent() {
            return _parent;
	}

        public GregorianCalendar getDateIntervention() {
                return _dateIntervention;
	}

	public TechnicienDto getTechnicien() {
                return _technicien;
	}

        public PrioriteDto getPrioriteIntervention() {
            return _prioriteIntervention;
        }

        public GregorianCalendar getHeureDebut() {
            return _heureDebut;
	}
        
        public GregorianCalendar getHeureFin() {
            return _heureFin;
	}
        
        public String getDescriptionIntervention() {
            return _descriptionIntervention;
	}
        
        public StatutDto getStatut() {
            return _statut;
	}
        public int getEnfant() {
            return _enfant;
	}
}